package testPackage;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;

import testPackage.Driver.BasePage;
import testPackage.Driver.GraduatedDriver;

public class Page extends BasePage {
	
    public Page(GraduatedDriver driver) {
		super(driver);
		//PageFactory.initElements(driver, this);
	    //his.driver = driver;

	}

	@FindBy(name = "q")
    private WebElement googleInput;
 
    @FindBy(name = "btnG")
    private WebElement result;
 
    public void SearchGoogle(String text)
    {
    	driver.get("http://www.google.com");
    	driver.findElement(By.name("q")).sendKeys(text);
    	//googleInput.sendKeys(text);
    	result.click();
    }
    
    public void LoginToVdma()
    {
    	driver.get("http://144.76.65.206:8080");
    	driver.findElement(By.name("login")).sendKeys("thorsten.meyer@vdma.org");
    	driver.findElement(By.xpath("//input[@id='password-placeholder']")).clear();
    	driver.findElement(By.name("password")).sendKeys("vdma007");
    	driver.findElement(By.xpath("//input[@value='Login']")).submit();
    }
    
    public void OpenMail()
    {
    	driver.findElement(By.xpath("//*[@class='vdma-mail']")).click();
    }
    
    public void OpenGroups()
    {
    	driver.findElement(By.xpath("//*[@class='vdma-groups']")).click();
    }
}


